package com.meij.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.meij.fragment.MainFragment;
import com.meij.fragment.PlaceholderFragment;

public class MainPagerAdapter extends FragmentPagerAdapter {
	private MainFragment mainFragment;

	public MainPagerAdapter(FragmentManager fm) {
		super(fm);
		mainFragment = new MainFragment();
	}

	@Override
	public Fragment getItem(int position) {
		switch (position) {
		case 0:
			return mainFragment;
		default:
			return PlaceholderFragment.newInstance(position + 1);
		}
	}

	@Override
	public int getCount() {
		return 5;
	}
}